package com.itheima.day01.Demo06;

/*测试类*/
public class AnimalDemo {
    public static void main(String[] args) {
        //创建猫的对象并进行测试
        Cat c = new Cat();
        c.setName("加菲");
        c.setAge(5);
        System.out.println(c.getName() + "," + c.getAge());
        c.method();
        System.out.println("--------------");
        Cat c1 = new Cat("加菲", 5);
        System.out.println(c1.getName() + "," + c1.getAge());
        c1.method();
        System.out.println("----------------");
        Dog d=new Dog();
        d.setName("大黄");
        d.setAge(8);
        System.out.println(d.getName()+","+d.getAge());
        d.show();
        System.out.println("----------------");

        Dog d1=new Dog("大黄",8);
        System.out.println(d1.getName()+","+d1.getAge() );
        d1.show();
    }
}
